package com.github.glomadrian.materialanimatedswitch.painter;

import com.github.glomadrian.materialanimatedswitch.observer.BallFinishObservable;
import com.github.glomadrian.materialanimatedswitch.observer.BallMoveObservable;
import ohos.agp.render.Canvas;
import ohos.agp.render.MaskFilter;
import ohos.agp.utils.Color;
import ohos.app.Context;

public class BallShadowPainter extends BallPainter {
    public BallShadowPainter(int bgColor,
                             int toBgColor,
                             int padding,
                             int shadowColor,
                             BallFinishObservable ballFinishObservable,
                             BallMoveObservable ballMoveObservable, Context context) {
        super(bgColor, toBgColor, padding, ballFinishObservable, ballMoveObservable, context);
        paint.setColor(new Color(shadowColor));
        paint.setMaskFilter(new MaskFilter(3, MaskFilter.Blur.NORMAL));
    }

    @Override
    public void draw(Canvas canvas) {
        canvas.drawCircle(ballPositionX, (height / 2) + 2, radius, paint);
    }
}
